public class Login {
    private String userName = "God";
    private String password = "123";
    public void loginInfo(String userName,String password) throws UserNameException,PasswordException{
        if(!this.userName.equals(userName)) {
            throw new UserNameException("用户名错误,你输入的用户名为:" + userName);
        }
        if(!this.password.equals(password)) {
            throw new PasswordException("密码错误,你输入的密码为:" + password);
        }
    }
}
